//设置课题详情
function setTaskDetail(data) {
    $("#task-tno").html(data.title1.tno);
    $("#task-sno").html(data.sno);
    $("#task-sname").html(data.sname);
    $("#task-from").html(data.title1.from);
    $("#task-id").html(data.title1.xtId);
    $("#task-title").html(data.title);
    $("#task-category").html(data.title1.categoty);
    $("#task-addtime").html(data.title1.addtime);
    $("#task-nature").html(data.title1.nature);
    $("#task-major").html(data.title1.majorName);
    $("#task-tname").html(data.title1.tName);
    $("#task-state").html(data.title1.state);
    $("#task-intr").html(data.title1.intr);
    $("#task-college").html(data.title1.collegeName);
}

function setStuInfo(data) {
    $("#sNO").val(data.sno);
    $("#major").val(data.title1.majorName);
    $("#sName").val(data.sname);
    $("#title").val(data.title);
}

/**
 * 提交审核
 * @param result 审核结果
 * @param opinion 审核意见
 * @param type 阶段
 * @param key 操作数据库的依据
 * @param bh 论文编号
 * @param userName 老师到的编号
 */
function addCheck(result, opinion, type, key, bh, userName) {
    let loadPage = layui.layer.load(0, {shade: [0.5, '#fff']});
    console.log(result, opinion, type, key, bh, userName);
    $.ajax({
        url: "/checkData",
        type: 'post',
        data: {
            result: result, opinion: opinion, type: type, key: key, bh: bh, userName: userName
        },
        dataType: 'json',
        async: false,
        success: function (data) {  //调用接口成功
            if (data === true || data === 'true') {
                layer.close(loadPage);
                layer.closeAll('page');
                layui.layer.msg('审核成功！', {offset: '300px', time: 2500, anim: 0});
            } else {
                layui.layer.close(loadPage);
                layui.layer.alert('审核失败！');
            }
        },
        error: function () {  //接口错误
            layui.layer.close(loadPage);
            layui.layer.alert('服务器出错啦,请稍后再试！');
        }
    });

}